package pl.edu.agh.jemo.evolution.operator.crossover.impl;

import javax.swing.JPanel;

import pl.edu.agh.jemo.evolution.operator.crossover.Crossover;
import pl.edu.agh.jemo.evolution.population.Population;

/**
 * This implementation of crossover does no action for given population.
 * It was designed to allow to switch of crossover part in algorithm.
 * It is recommended to use this crossover, rather then other implementations with 0 chance of recombination, due to performance reasons.
 * Also this implementation leaves given population completly unaffected.
 * 
 * @author Marcin Zbijowski
 *
 */
public class EmptyCrossover implements Crossover {

	/**
	 * Does nothing for given population.
	 * 
	 * @param population Parameter not used, but for compliance with rest of operators it is recomended, to pass population reference, that would have been recombinated by normal crossover.
	 */
	@Override
	public void performCrossover(Population population) {
	}

	/**
	 * Returns null - Empty Crossover doesn't require any configuration.
	 * 
	 * @return null value.
	 */
	@Override
	public JPanel getConfigPanel() {
		return null;
	}

	/**
	 * Returns String description of crossover, in this case only information is that Empty crossover is used.
	 * 
	 * @return String saying Empty Crossover is used.
	 */
	@Override
	public String toString() {
		return "Crossover class: EmptyCrossover\n";
	}
}
